package com.hulu73.shiro.controller;

import javax.servlet.http.HttpServletRequest;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.hulu73.shiro.entity.UserEntity;

@Controller
@RequestMapping("/f")
public class IndexController {

	@RequestMapping(value="/index", method = RequestMethod.GET)
	public  String toIndex(Model	model,HttpServletRequest httpServletRequest){
		 Subject subject = SecurityUtils.getSubject();  
		UserEntity user = (UserEntity)subject.getPrincipals().getPrimaryPrincipal();
    	model.addAttribute("user", user);
		return "/f/index";
	}
	
}
